rack one's brain wits

(为某事)绞尽脑汁,苦思冥想